import Mock from 'mockjs';

// 功能菜单树结构数据 - 匹配实际后端数据结构
const funcListData = {
  roleIds: 1,
  userName: 'admin',
  userId: 1,
  level: null,
  groupIds: 1,
  funcList: [
    {
      funcId: 'f010',
      funcName: '督察管理',
      funcPath: null,
      upFuncId: null,
      index: null,
      children: [
        {
          funcId: 'f011',
          funcName: '督察任务管理',
          funcPath: '/supervision/query',
          upFuncId: 'f010',
          index: 1,
          children: []
        }
      ]
    },
    {
      funcId: 'f001',
      funcName: '系统管理',
      funcPath: '',
      upFuncId: null,
      index: null,
      children: [
        {
          funcId: 'f002',
          funcName: '用户管理',
          funcPath: '/user/query',
          upFuncId: 'f001',
          index: 1,
          children: []
        },
        {
          funcId: 'f003',
          funcName: '角色管理',
          funcPath: '/role/query',
          upFuncId: 'f001',
          index: 2,
          children: []
        },
        {
          funcId: 'f004',
          funcName: '组织架构管理',
          funcPath: '/group/query',
          upFuncId: 'f001',
          index: 3,
          children: []
        }
      ]
    }
  ]
};

// 获取功能菜单列表
Mock.mock(new RegExp('/api/funcList'), 'get', () => {
  return {
    code: 200,
    message: 'success',
    data: funcListData
  };
});
